<?php
$tmp = explode(";", $_SERVER['QUERY_STRING']);
$tmp = explode(",",$tmp[1]);
$mid = $tmp[1];
if (isset($mid) && (int)$mid) {
	$info = mysql_fetch_assoc(mysql_query1("SELECT * FROM php_func WHERE id='" . $mid ."'"));
	echo "
		<div class=\"title\"><b>" . $info['pavadinimas'] . "</b></div>
     	<div class=\"vidus\">
		<table width='100%' border='0' cellspacing='0' cellpadding='0'>
			<tr>
				<td width='15%' class='vidus'>Autorius: " . $info['autorius'] ."</td>
				<td width='15%' class='vidus'>Data: " . $info['data'] ."</td>
				<td width='50' class='vidus'>Aprašymas: " . $info['aprasymas'] ."</td>
			</tr>
				<td colspan='3'> " . $info['kodas'] ."</td>
			</tr>
		</table>
		</div>
	";
}
else {
	echo "
     	<div class=\"title\">PHP Funkcijų aprašymai</div>
     	<div class=\"vidus\">
     	<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
     		<tr>
     			<td class=\"title\" width=\"15\">Masyvas</td>
     			<td class=\"title\" width=\"200\">Aprašymas</td>
     			<td class=\"title\" width=\"50\">Autorius</td>
     			<td class=\"title\" width=\"30\"></td>
     		</tr>
	";
	$info = mysql_query1("SELECT * FROM php_func WHERE did='" . $id ."'");
	while ($row = mysql_fetch_assoc($info)) {
		echo "<tr>";
		echo "<td class=\"vidus\">" . $row['pavadinimas'] ."</td>";
		echo "<td class=\"vidus\">" . $row['aprasymas'] ."</td>";
		echo "<td class=\"vidus\">" . $row['autorius'] ."</td>";
		echo "<td class=\"vidus\"><a href='?id,". $id .";m," . $row['id'] ."'>Plačiau</td>";
		echo "</tr>";
	}
	echo "</div>";
}
?>
